<?php

define("_DATABASE_TYPE_ORACLE"                     , "ORACLE");
define("_DATABASE_TYPE_MYSQL"                      , "MYSQL");
define("_DATABASE_TYPE_POSTGRESQL"                 , "POSTGRESQL");

include_once "DbVars.php";
include_once "Oracle.php";
include_once "MySQL.php";

class Database{

  /**
   * Database init
   *
   * @param string $dbType
   * @param Misc   $ErrHdl
   */
  function initTech($dbType, &$ErrHdl){

    switch($dbType){

      case _DATABASE_TYPE_ORACLE:

        return new Oracle;
        break;

      case _DATABASE_TYPE_MYSQL:

        return new MySQL;
        break;

      case _DATABASE_TYPE_POSTGRESQL:

        return new PostgreSQL;
        break;

      default:
        $ErrHdl->usrDie("Error: Invalid or bad defined DB Type");
    }
  }
}

?>